@extends('seller::layout.master')

@section('body-class', 'page-login')

@section('content')
  <div class="container">
    <div class="d-flex align-items-center pt-2 pt-sm-5 pb-4 pb-sm-5">
      <div class="card">
        <div class="w-480">
          <div class="card-header mt-3 mb-4">
            <h4 class="fw-bold">{{ __('seller::login.index_login') }}</h4>
          </div>
          <div class="card-body">
            <form action="{{ seller_route('login.store') }}" method="post">
              @csrf
              @if (session('error'))
                <div class="alert alert-danger mt-n4">
                  {{ session('error') }}
                </div>
              @endif

              <div class="form-floating mb-4">
                <input type="text" name="email" class="form-control" id="email-input" value="{{ old('email', $admin_email ?? request('admin_email')) }}" placeholder="{{ __('common.email') }}">
                <label for="email-input">{{ __('common.email') }}</label>
                @error('email')
                  <div class="form-text text-danger">{{ $message }}</div>
                @enderror
              </div>

              <div class="form-floating mb-3">
                <input type="password" name="password" class="form-control" id="password-input" value="{{ old('password', $admin_password ?? request('admin_password')) }}" placeholder="{{ __('shop/login.password') }}">
                <label for="password-input">{{ __('shop/login.password') }}</label>
                @error('password')
                  <div class="form-text text-danger">{{ $message }}</div>
                @enderror
              </div>

              <div class="d-flex justify-content-end mb-5">
                <a href="{{ seller_route('register.index') }}" class="text-secondary">{{ __('seller::login.new_seller') }}</a>
              </div>

              <div class="d-grid mb-4"><button type="submit" class="btn btn-lg btn-primary">{{ __('admin/login.log_in') }}</button></div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

  <style>
    .header-mobile {
      display: none;
    }
  </style>
@endsection